import sys

def collatz(number):
    print(number)
    if number == 1:
        sys.exit()
    elif number % 2 == 1 :
        t = 3*number+1
        return collatz(t)
    else:
        t = number//2
        return collatz(t)

def putin():
    try:
        putin = int(input("输入数字："))
    except:
        print('请输入整数！')
    collatz(putin)

putin()